import React from 'react'
import './input.scss'
const Input = (props) => {
  return <input {...props} type={props.type} />
}

class CustomizeInput extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      errobj: '',
      arr: []
    }
  }
  render() {
    const {
      value = '',
      clear,
      type,
      name,
      help,
      onsetair,
      clearIsshow,
      ...otherProps
    } = this.props
    return (
      <>
        <div style={{ padding: 10 }} className="input-wapper">
          <span className="left-text">{this.props.lefttext}</span>
          <Input value={value} {...otherProps} type={type} />
          {clear && clearIsshow ? (
            <a
              className="clear"
              onClick={() => {
                onsetair()
              }}
            >
              {' '}
              x{' '}
            </a>
          ) : (
            ''
          )}
        </div>
        <p
          style={{
            color: 'red',
            fontSize: '12px',
            textAlign: 'left',
            marginBottom: '20px'
          }}
        >
          {help}
        </p>
      </>
    )
  }
}

export default CustomizeInput
